-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Add bigNumberStrings option for forcing BIGINTs as strings (always) #437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I like this. Recently updated to Alpha 7 to get the pooling functionality only to find that my iOS app wasn't playing nicely with my api anymore. BIGINTs used to be strings only. Why do we need to have two different types going on? |
@dresende also, whatever you do decide on doing. The Readme only mentions bigints being typecast to strings. |
Just as a side note, I was unsure about the insertId that can be retrieved upon executing an INSERT query. https://github.com/felixge/node-mysql/blob/master/lib/protocol/packets/OkPacket.js Apparently in C/C++ bindings mysql treats this field as BIGINT (LONGLONG), whatever the table's original numeric-type field is. |
@felixge I think this may have been closed pre-maturely. Although the insertId case has been fleshed out, the main topic of this pull request was the ability to have bigints be returned exclusively as strings. |
I tend to agree with @tomasikp, this option might be good for people knowing about bigint problems and wanting to always have these numbers as strings. |
#414 Apparently DECIMAL was also changed to the quasi-type (Number/String). I think we should definitely have an option to have all of these remain strings if possible |
Like @dresende and @tomasikp said, the point of this commit was not about the insertId but about adding an option for allowing big numbers to be always returned as strings, rather than being a "Number or String"-volatile type. The current behavior is still allowed, and this new behavior is also possible, respectively, by not using or using bigNumberStrings option. |
Fix error reported by `go vet`
Hi there. It is just as the title mentions.
I have followed #207 attentively, but in one
app I am developing we use lots of BIGINT columns.
I am aware that using supportBigNumbers:true handles big numbers
in case hey cannot be accurately represented returning them as strings.
In our app, it is easiest to assume that they will be always strings,
and it is quite a pain and error-prone for us to convert all BIGINTs
to strings, so we added this option.
I would be happy if you could push these commits in your repo.
Thank you in advance.